#include "instructions/stack/swap.h"

namespace jvm {
namespace instructions {

void SWAP::execute(std::shared_ptr<rtda::Frame> frame) {
    auto stack = frame->getOperandStack();
    auto slot1 = stack->popSlot();
    auto slot2 = stack->popSlot();
    stack->pushSlot(slot1);
    stack->pushSlot(slot2);
}

} // namespace instructions
} // namespace jvm